#ifndef MYTP_H
#define MYTP_H
#include <QSerialPort>
#include <QThread> 
// class WorkerThread : public QThread
// {
//      Q_OBJECT
//      void run() override {
//          QString result;
//           ... here is the expensive or blocking operation ... 
//          emit resultReady(result);
//      }
//  signals:
//      void resultReady(const QString &s);
//  };
class MyTp: public QThread
{
    Q_OBJECT
public:
    MyTp();
    ~MyTp();
    QSerialPort * pmyport;
    double read();
    bool isOpen;
    void parse(QString s);
    bool begin;
    QStringList str_list;
    QString last;
    void startWorkInAThread();
    void open();
    double old_value;
public slots:
    void onReady();  
    // void handleResults();
    // void deleteLater();  
signals:
    void dataArrive(double l);    
};

#endif // MYTP_H
